Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Agora
Contributor
Contributor

How to make a 'measure' from a dimension

Hi,

 

I have a dimension 'invoice number'.

In order to control if data is fully loaded i want to compare 

- count of invoice numbers

with

- (max)invoicenumber - (min)invoicenumber --> but i don't know how to create this as a master measure from the dimension invoicenumber.

Ideas?

 

 

Labels (1)
4 Replies
cristianj23a
Partner - Creator III
Partner - Creator III

Hi, is this code useful?

 

LOAD *,
Count(InvoiceNumber) as CountOfInvoiceNumbers,
Max(InvoiceNumber) - Min(InvoiceNumber) as DifferenceMaxMinInvoice
Resident YourTable;

 

If it is not what you want, you can give me more detail with some examples.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
mjht
Creator
Creator

I am just wondering why you need it to be a master measure? 

 Also - is there a possibility that you could have duplicate invoice numbers ?  Perhaps an invoice comes thru with a correction.  In that case simply taking the max(invoice number) - min(invoice number) would not necessarily give you the correct answer.

cristianj23a
Partner - Creator III
Partner - Creator III

I couldn't give you the answer because I don't know how your tables are structured, your queries are very general, if you give me more detail with examples I could help you.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
mjht
Creator
Creator

@cristianj23a  - my response was to @Agora .  I think you really wanted to address your response to @Agora  and not me.