Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

'Dual' not working?please help

Hi,

I have below script in qvw. when I reload I can able to see in Flag column only START and GONE. Remaining are not loading into Flag column. Please can anyone suggest me is there any wrong in below script?

If (MixMatch(NAME,'XX',

'YY',

'ZZ',

'AA',

'BB',

'CC',

'DD',

'EE',

'FF',

'GG',

'HH',

'II',

'JJ',

'KK',

'LL',

'MM',

'NN',

'OO',

'PP',

'QQ,

'RR',

'SS',

'TT',

'UU',

'VV',

'WW'),Dual('START',1),

     If(MixMatch(NAME,'GONE'),Dual('GONE',2),

If(MixMatch(NAME,'QQ,

'RR',

'SS',

'TT',

'UU'),Dual('APP',3)

     If(MixMatch(NAME,'XX',

'YY',

'ZZ',

'AA',

'BB',

'CC',

'DD',

'EE',

'FF',

'GG',

'HH',

'II',

'JJ',

'KK',

'LL',

'MM',

'NN',

'OO',

'PP',

'VV',

'WW'),Dual('PROCESS',4),

     If(MixMatch(NAME,

'YY',

'ZZ',

'AA',

'BB',

'CC',

'DD',

'EE',

'FF',

'GG',

'HH',

'II',

'JJ',

'KK',

'LL',

'MM',

'NN',

'OO',

'PP',

'QQ),Dual('CON',5))))))                         as Flag

Thanks.

43 Replies
Not applicable
Author

tried this. still showing same 0%

sunny_talwar

Few things to check:

  • Are you doing this in a text box object or some sort of chart?
  • You said this alone worked: =Count({<FlagNew= {'START'}>} FlagNew), does this work alone as well? =Count({<FlagNew= {'GONE'}>} FlagNew)
Not applicable
Author

I have tried in pivot table. when I used the below expression in text object it is working. only in chart it is not working.

=Count({<FlagNew= {'START'}>} FlagNew), does this work alone as well? =Count({<FlagNew= {'GONE'}>} FlagNew)

yes alone both working in text object. but alone both are not working in chart.

sorry I thought you want me to use in chart. so, I have used in chart earlier.

EDIT: I have two dimensions as below in pivot chart

FlagNew

Month

sunny_talwar

Can I suggest you changing your model from current one to a new model?

OriginalTable

LOAD *,             If(MixMatch(NAME,'XX','YY','ZZ','AA','BB','CC','DD','EE','FF','GG','HH','II','JJ','KK','LL','MM','NN','OO','PP','QQ,'RR','SS','TT','UU','VV','WW'), 1, 0) as START_Flag,

If(MixMatch(NAME,'GONE'), 1, 0) as GONE_Flag,

If(MixMatch(NAME,'QQ,'RR','SS','TT','UU'), 1, 0) as APP_Flag,

If(MixMatch(NAME,'XX','YY','ZZ','AA','BB','CC','DD','EE','FF','GG','HH','II','JJ','KK','LL','MM','NN','OO','PP','VV','WW'), 1, 0) as PROCESS_Flag,

If(MixMatch(NAME,'YY','ZZ','AA','BB','CC','DD','EE','FF','GG','HH','II','JJ','KK','LL','MM','NN','OO','PP','QQ), 1, 0) as CON_Flag,

If(MixMatch(NAME,'XX','YY','ZZ','AA','BB','CC','DD','EE','FF','GG','HH','II','JJ','KK','LL','MM','NN','OO','PP','QQ,'RR','SS','TT','UU','VV','WW', 'GONE'), 1, 0) as SUCCESS_FLAG;

LOAD allYourFields

FROM source

and try this expression:

=Sum(START_Flag)/Sum(GONE_Flag)

swuehl
MVP
MVP

EDIT: I have two dimensions as below in pivot chart

FlagNew

Month

Ah, ok.

The FlagNew dimension will prevent the two expressions to be evaluated as requested in the same line, unless...

=Count({<FlagNew= {'START'}>} TOTAL<Month> FlagNew)

/

Count({<FlagNew= {'GONE'}>} TOTAL<Month> FlagNew)

Not applicable
Author

Thanks. I have tried this. showing percentage as all 100% and showing 1 in  START_Flag and 1 in GONE_Flag.

remaining flag column values showing as zeroes.

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Please post a sample file with data

Not applicable
Author

Thanks. I have tried this. I can able to see the percentage. is there any way in pivot table to show GONE percentage related to GONE column line , START percentage to sow only to START column line and so on. at present it is showing as below

                                                                                   

MONTHOct 2013Oct 2013Oct 2013Oct 2013Nov 2013Nov 2013Nov 2013Nov 2013
FlagNewCountGONE %APP %START %CountGONE %APP%START %
START367%22%11%1865%27%8%
GONE667%22%11%3465%27%8%
APP167%22%11%465%27%8%
PROCESS267%22%11%1465%27%8%
CON267%22%11%1465%27%8%
SUCCESS967%22%11%5265%27%8%

but I want the pivot table to show as below

                                                

MONTHOct 2013Oct 2013Nov 2013Nov 2013
FlagNewCount%Count%
START311%188%
GONE667%3465%
APP122%427%
PROCESS250%1478%
CON224%1490%
SUCCESS910%52100%

Is there any way to do this. Please help.

swuehl
MVP
MVP

It would be more than helpful if you post your current working sample. It's kind of confusing looking at tables with numbers without knowing the current implemented expressions.

(I believe you are not using

=Count({<FlagNew= {'START'}>} TOTAL<Month> FlagNew)

/

Count({<FlagNew= {'GONE'}>} TOTAL<Month> FlagNew)


for START %, right?

)

In general, I believe you want only a single expression for %, and this expression needs to consider the current dimension value for FlagNew. So at least the numerator should not use a set expression that makes a selection in that field.

Again, I somehow lost what you want to calculate, your current Count numbers and % does not show what I think you requested last (maybe I missed a new requirement).

I assume you need an expression like

=Count(FlagNew) / Count({<FlagNew= {'GONE'}>} TOTAL<Month> FlagNew)

but I am pretty much guessing, you need to give more information  if you want us to help you.

Not applicable
Author

I am using the below expression

=Count({<FlagNew= {'START'}>} TOTAL<Month> FlagNew)

/

Count({<FlagNew= {'GONE'}>} TOTAL<Month> FlagNew)


for START %

I am getting expected result when I used above expression. All I need is percentages are showing multiple times for all rows. Instead of the I need START percentage next to START value. GONE percentage next to GONE value, APP percentage next to APP value and so on.

is it possible please let me know.