This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF left ([Title],1) = '1' | |
or left ([Title],1) = '2' | |
or left ([Title],1) = '3' | |
or left ([Title],1) = '4' | |
or left ([Title],1) = '5' | |
or left ([Title],1) = '6' | |
or left ([Title],1) = '7' | |
or left ([Title],1) = '8' | |
or left ([Title],1) = '9' then 'starts with a number' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------MySQL----------------------------------------------------------- | |
select | |
title as Adtitle, | |
#--count the number of words in the title | |
length(title) - length(replace(title, ' ', '')) + 1 as AdTitleWordLength, | |
#--analyse the punctuation of a title | |
case |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----------------------------------------------Vertica------------------------------------------------------------- | |
select | |
replace('We love you', 'We', 'I'), -- reolaces a string with another | |
' I love you ' as MyPhrase, | |
ltrim(' I love you '), --removes spaces on the left | |
rtrim(' I love you '), --removes spaces on the right | |
trim(' I love you ') --removes spaces on both sides |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------SQL Server--------------------------------------- | |
select | |
'I love you' as phrase, | |
len('I love you') as phrase_length, | |
len(' I love you ') as phrase_length2, | |
datalength(' I love you ') as phrase_length3 | |
phrase |phrase_length |phrase_length2 |phrase_length3 | | |
-----------|--------------|---------------|---------------| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----------------------SQL server------------------------------- | |
select | |
'I love you' as phrase, | |
substring('I love you', 3,4) as phrase2 | |
phrase |phrase2 | | |
-----------|--------| | |
I love you |love | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------MySQL------------------------------------------------------------------------ | |
select | |
'The first agreement is to be impeccable with your word. | |
When you are impeccable, you take responsibility for your actions, but you do not judge or blame yourself! | |
Being impeccable with your word is not using the word against yourself. | |
Being impeccable with your word is the correct use of your energy' as phrase, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------MySQL----------------------------------------------------- | |
select | |
'I love you' as phrase, | |
left ('I love you', 1), | |
mid('I love you', 3, 4), | |
right('I love you', 3) | |
phrase |left ('I love you', 1) |mid('I love you', 3, 4) |right('I love you', 3) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub RefreshPTs() | |
Dim Wbk As Workbook | |
Dim Wks As Worksheet | |
Dim PT As PivotTable | |
Dim PC As PivotCache | |
'***************************** | |
'written by Angelina Teneva | |
'***************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ShowFieldinPT() | |
Dim Wks As Worksheet | |
Dim PT As PivotTable | |
Dim PF As PivotField | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'written by Angelina Teneva, Sept 2016 | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
For Each Wks In ActiveWorkbook.Worksheets |