Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
if value of “klant_nr” = 000000,
then
count(distinct %key_retail_customer_no)
as
count(distinct [Document No_])
How should i run this in the script?
Are you trying comparison? I am not understanding this part
as count(distinct [Document No_])
only when
klant_nr = 000000
then i want
the count of variable "%key_retail_customer_no"
to be replaced by
the count of variable "Document No_"
You mean like this
If klant_nr=000000 THEN
Load distinct count(%key_retail_customer_no) as %key_retail_customer_no Resident XYZ;
Else
Load count("Document No_") as "Document No_" Resident ABC;
EndIf
Hi @EllenBerden , here another option.
It makes an aggregation using count and group by, and a where clause to reduce the data.
Load
your fields....,
count(distinct %key_retail_customer_no) as CountField
From YOURSOURCE
Where
klant_nr = 000000
Group By
your fields....;
concatenate ///optional
Load
your fields....,
count(distinct [Document No_]) as CountField
From YOURSOURCE
Where
klant_nr <> 000000
Group By
your fields....;