Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

kumarreddy257
Not applicable

set analysis

Hi,

Is any thing wrong in this expression. Pls help me

Count(text([Campaign Channel])='PPC')[Site Visit Vis Num]

14 Replies
greeshma_k
Not applicable

Re: set analysis

Count({<[Campaign Channel]={'PPC'}>}[Site Visit Vis Num])

kumarreddy257
Not applicable

Re: set analysis

I have to use text function in set analysis

vardhancse
Not applicable

Re: set analysis

What is the value for Campaign Channel field

PrashantSangle
Not applicable

Re: set analysis

Hi,

Try

Count(if(text([Campaign Channel])='PPC'),[Site Visit Vis Num]))

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
tresesco
Not applicable

Re: set analysis

Two issues:

  • Improper expression (syntax/structure) - the correct way of set analysis expression is -  Count({<[Campaign Channel]={'PPC'}>}[Site Visit Vis Num])
  • Improper Set Expression syntax - Count({<Text([Campaign Channel])={'PPC'}>}[Site Visit Vis Num]) - left hand side of set expression can only be a script generated field , so no function can be used like text().

Instead you can create a field in the script with text() and use that in set expression like:

Load

          Text([Campaign Channel]) as TextChannel

              ....

Then, Count({<TextChannel={'PPC'}>}[Site Visit Vis Num])

Or,

try with simple IF statement.

kumarreddy257
Not applicable

Re: set analysis

In Qvx target file data type is unknown, but campaign channel is char.

kumarreddy257
Not applicable

Re: set analysis

Can't we use this functions directly in set analysis

tresesco
Not applicable

Re: set analysis

No. Not on the LHS.

Toni_Kautto
Not applicable

Re: set analysis

A set expression contains set modifiers, which efficiently are equal to selections. The text you define in the set modifier, will apply a selection in the same way as if it was a search string. Naturally a search string like "=Text(MyValue)" will search for the value "=Text(MyValue)" and not the result you would get if the function was evaluated.

You can accomplish a calculation in the set modifier by using dollar expansion, but this require that you consider how the expansion is made.

Set expression and dollar expansion