Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HI All,
I hope you are able to assist.
I am trying to import write an if wildmatch statement with some multiplication in my load script. the syntax is correct however i am not getting the desired result. here is my load statement:
Load
if(
WildMatch([Share of fabric in the style (shell fabric) 4] , '*PADDING*') and WildMatch(Fibre ,'*GRS') and
[Share of fabric in the style (percentage) 4]/100 * [Share of sustainable quality in the fibre(percentage) 2]/100 * Percentage/100 >=1 ,
'We Care',
'Not Sustainable')
as [We Care]
FROM [lib://Qlik Sense E Drive/Live/~~~~~/QVD's/AllData.QVD]
(qvd);
As you can see i need to multiply 3 dimensions and if they match the stated values (*PADDING) and (*GRS) and are equal to or greater than 1, name as We Care, if not all of the above name as Not Sustainable.
As mentioned i thought this was working well however i have an instance where the multiplication result is .3 and yet the result is still We Care when i have specified it must be over 1.
this makes me believe something in the way i have written is not correct.
Can anyone advise on if my syntax is correct for ALL of the variables to be met to be we care?
Thank you for your time in advance,
Daniel
@davyqliks try below
if(
WildMatch([Share of fabric in the style (shell fabric) 4] , '*PADDING*') and WildMatch(Fibre ,'*GRS') and
(([Share of fabric in the style (percentage) 4]/100 )* ([Share of sustainable quality in the fibre(percentage) 2]/100) *( Percentage/100)) >=1 ,
'We Care',
'Not Sustainable')
as [We Care]
@davyqliks try below
if(
WildMatch([Share of fabric in the style (shell fabric) 4] , '*PADDING*') and WildMatch(Fibre ,'*GRS') and
(([Share of fabric in the style (percentage) 4]/100 )* ([Share of sustainable quality in the fibre(percentage) 2]/100) *( Percentage/100)) >=1 ,
'We Care',
'Not Sustainable')
as [We Care]
Thanks you for the reply and suggestion.
I am a little confused.
in the load i have added this:
Load
*,
if(
WildMatch([Share of fabric in the style (shell fabric) 2] , 'LINING') and WildMatch(Fibre ,'Polyester GRS') and
(([Share of fabric in the style (percentage) 1]/100 )*([Share of sustainable quality in the fibre(percentage) 1]/100) *( Percentage/100)) >=.2 ,
'We Care', 'Not Sustainable'
)
as [We Care]
and i get the following:
If i add the if statement to the table as a measure i get the following:
But if i remove the fibre from the table i get the following with the measure in the table:
and this from the load script:
do you have any idea why i might be getting these mixed results.
Thanks so much for your help on this @Kushal_Chawda
Daniel
@davyqliks You have created that field in script which you cannot use it in measure. You need to use it in dimension. Check that you are getting correct values for all required condition.
Thank you,
This does work in principle but i have so many variables i need to put another layer of matching in place or i get cross over results, but thank you so much for the reply and for your time.
Regards,