Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

How to write different formulae for each cell?

LYLY LMYTDYTD LM
A *
B
C

* = Formulae

I have such situation, in which neither first row nor first column is dimension.

We have to manually write formula for 1 row 1 column , 2 row 1 column , ......... matrix like this.

Please help.

2 Solutions

Accepted Solutions
Highlighted
Partner
Partner

You can try as below:

Dimension : Valuelist('A','B','C')

Measure 1 - LY

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression1 for A,

Expression1 for B,

Expression1 for C

)

Measure 2 - LY LM

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression2 for A,

Expression2 for B,

Expression2 for C

)

Measure 3 - YTD

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression3 for A,

Expression3 for B,

Expression3 for C

)

Measure 4 - YTD LM

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression4 for A,

Expression4 for B,

Expression4 for C

)

View solution in original post

Highlighted
Partner
Partner

I could only do this:

put your expressions into this again with proper backets..

If(Wildmatch(Valuelist('PRO','HFRP','WEB'),'PRO') ,

if(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'Gross'),

Expression1,

If( Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'Net'),

Expression2,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'L2S'),

Expression3,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'CPS'),

'-'

)))),

If(Wildmatch(Valuelist('PRO','HFRP','WEB'),'HFRP') ,

if(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'Gross'),

Expression1,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'Net'),

Expression2,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'L2S'),

Expression3,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'CPS'),

'-'

))))

,

If(Wildmatch(Valuelist('PRO','HFRP','WEB'),'WEB') ,

If(  Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'Gross'),

Expression1,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'Net'),

Expression2,

If( Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'L2S'),

Expression3,

If(Wildmatch(Valuelist('Gross','Net','L2S','CPS'),'CPS'),

'-'

))))

)))

View solution in original post

26 Replies
Highlighted

This?

If(Match(FieldName, 'LY') and Match(FieldName1, 'A'), Formulae,

If(Match(FieldName, 'LY') and Match(FieldName1, 'B'), Formulae, ....))

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Specialist
Specialist

You are taking table only?

Because here, if you write code for particular dimension field like A,B,C then if field value increases then that will become issue, rather than you can use text object

Highlighted
Specialist
Specialist

A,B,C and LY, YTD LY etc are not the feilds.We will have to write it manually.

Highlighted
Partner
Partner

You can try as below:

Dimension : Valuelist('A','B','C')

Measure 1 - LY

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression1 for A,

Expression1 for B,

Expression1 for C

)

Measure 2 - LY LM

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression2 for A,

Expression2 for B,

Expression2 for C

)

Measure 3 - YTD

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression3 for A,

Expression3 for B,

Expression3 for C

)

Measure 4 - YTD LM

pick(Wildmatch(Valuelist('A','B','C'),'A','B','C'),

Expression4 for A,

Expression4 for B,

Expression4 for C

)

View solution in original post

Highlighted

Yes, Those are not the fields but we can achieve the same

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Specialist
Specialist

Thank you so so much Shraddha.Its working.

Regards,

Shubham

Highlighted
Specialist
Specialist

A,B,c,d,e,g will be my string only

Now I have such Pivot table structure and same situation as before.

It worked in Straight table.

How to do it in PIVOT Table?

Highlighted
Partner
Partner

Do you mean to say you will be having 4 different expressions for these pairs?

Highlighted
Specialist
Specialist

Ya,It is same as before but 4 valuelist variables will have one common name