Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good day all.
I normally use >= in my set analysis but am wondering if there is a way of using >= in the load script?
Thank you - stay safe..
I suspect that your Document Type is being seen as text. Try IF(Physical='1' and SearchType='4' and Num#(DocumentType)<=5,DiscountAmount) as [Total_Sale]
You could also use Match(DocumentType,3,4,5) if you want to fix the range. Might need to use Match(Num#(DocumentType),3,4,5).
@johngouws wrote:....
Thank you - stay safe..
Yes. This is very important now across the world. Thank you. STAY ISOLATED, STAY SAFE, Keep others safe.
Coming back to your question. You can use the same comparison operator '>=' or '<=' in the script. If you are facing issue, it could be because of the way you are trying. You can share your issue.
Hi @johngouws
You can use it as is. For example: If(Sales>=200,'Big','Small') Just make sure that the field you are evaluating has the same format as the value you are comparing it to (num if comparing to a num or date when comparing to a date).
LOAD *,
If(Date<'2013/02/01','Pre Feb 2013','Post Feb 2013') AS [Date Group],
If(Sales>=200,'Big','Small') AS [Sale Size]
Inline [
Date,Sales
2012/12/02,400
2013/01/01,880
2013/02/01,90
2013/03/01,370
];
Hope this helps.
Regards,
Mauritz
Thank you for responses.
I am doing something 'st??pid! This is what I am doing in the script:
IF(Physical='1' and SearchType='4' and DocumentType='3' ,DiscountAmount*-1,DiscountAmount) as [Total_Sale]
Please where is the issue..
Hi John
The syntax looks right. What is the issue that you're experiencing? Maybe you could post a snippet of the straight table with Physical, SearchType, DocumentType, DiscountAmount and [Total_Sale] in it?
It looks fine. Now you have to tell us 'where is the issue' and where is '>=' ?
Apologies,
What I am trying to do is replace the (DocumentType='3' or DocumentType='4' or DocumentType='5') with DocumentType<='5'.
If I use:
IF(Physical='1' and SearchType='4' and (DocumentType='3' or DocumentType='4' or DocumentType='5') ,DiscountAmount) as [Total_Sale] I get a different result to when I use
IF(Physical='1' and SearchType='4' and (DocumentType<='5') ,DiscountAmount) as [Total_Sale]
Are you sure you don't have a Document Type smaller than 3?
Yes I am sure
Could you share a sample reproducing the issue?