Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Shubham_Deshmukh
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
shraddha_g
Partner - Master III
Partner - Master III

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

shraddha_g
Partner - Master III
Partner - Master III

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
Anil_Babu_Samineni

This?

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

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
neha_shirsath
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

Shubham_Deshmukh
Specialist
Specialist
Author

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

shraddha_g
Partner - Master III
Partner - Master III

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

)

Anil_Babu_Samineni

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

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Shubham_Deshmukh
Specialist
Specialist
Author

Thank you so so much Shraddha.Its working.

Regards,

Shubham

Shubham_Deshmukh
Specialist
Specialist
Author

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?

shraddha_g
Partner - Master III
Partner - Master III

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

Shubham_Deshmukh
Specialist
Specialist
Author

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